package com.itany.corejava.code08_常用类.其他类;

import java.util.Random;

/**
 * @author 石小俊
 * @date 2023年04月28日 14:42
 */
public class Test03_Random {

    public static void main(String[] args) {
        Random random = new Random();

        System.out.println(random.nextInt());
        System.out.println(random.nextLong());
        System.out.println(random.nextDouble());
        System.out.println(random.nextFloat());
        System.out.println(random.nextBoolean());
        // 获取0-9的随机整数
        System.out.println(random.nextInt(10));
        // 获取15-32的随机整数
        System.out.println(random.nextInt(18) + 15);

    }

}
